﻿@{
    Layout = "/Areas/Admin/Views/Shared/Manager.cshtml";
}
@model IEnumerable<Shumei.EFCore.Model.New>
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <script type="text/javascript">
        @*$(function () {
            var i = @ViewBag.page
            $(".pag").removeClass("active");

            $(".pag").each(function (index, element) {
                if (index == i-1)
                    $(this).addClass("active");
            });
        });*@
        
    </script>

</head>
<body>
    <div>
        <!-- 新闻列表 -->
        <h3>所有资讯列表</h3>

        <div class="hr-div"> <hr /></div>
        <div class="table-responsive">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <th style="text-align:center;">ID</th>
                        <th style="text-align:center;">栏目</th>
                        <th style="text-align:center;">标题</th>
                        <th style="text-align:center;">发布者</th>
                        <th style="text-align:center;">发布时间</th>         
                        <th style="text-align:center;">
                        <div>
                            <a href="@Url.Action("UploadNews", "News")" class="label label-default">发布新新闻</a>
                        </div> 
                        </th>  
                                      
                    </tr>
                </thead>
                <tbody>
                    @{
                        foreach (var m in Model)
                        {
                            <tr style="text-align:center;">
                                <td>@m.Id</td>
                                <td>@m.category.Text</td>
                                <td>@m.Title</td>
                                <td>@m.user.name</td>
                                <td>@m.UploadTime</td>
                                <td>
                                <a href="@Url.Action("EditNew", "News", new { id=m.Id})" class="label label-default">编辑</a>
                                    <a href="@Url.Action("DeleteNew", "News", new { id=m.Id})" class="label label-danger">删除</a>
                                </td>
                                
                            </tr>
                        }
                      }
                </tbody>
            </table>
        
        </div>
        <div style="margin-bottom:30px;">
            <button type="button" class="btn btn-default" aria-label="Left Align">
                <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>
            </button>
            <input type="text" style="width:25px;" value="@ViewBag.page"/>
            <button type="button" class="btn btn-default" aria-label="Left Align">
                <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>
            </button>
            <label>total:@ViewBag.totalPage</label>
        </div>
    </div>
</body>
</html>
